package com.tzy.spi.core;

public class BeanHolder {


    public String name;

    public Object enhanceBean;

    public Object bean;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getEnhanceBean() {
        return enhanceBean;
    }

    public void setEnhanceBean(Object enhanceBean) {
        this.enhanceBean = enhanceBean;
    }

    public Object getBean() {
        return bean;
    }

    public void setBean(Object bean) {
        this.bean = bean;
    }

    public Object get(boolean wrapper) {

        if (!wrapper) {
            return getBean();
        }


        if (getEnhanceBean() == null) {
            return getBean();
        }

        return getEnhanceBean();
    }

}
